//数组对象去重
function ArrayReduce(array) {
    var obj = {};
    var redArray = array.reduce((cur, next) => {
        obj[next.key] ? '' : (obj[next.key] = true && cur.push(next));
        return cur;
    }, []);
    return redArray;
}

let arrJson = [{
    name:"a"
},{
    name:'b'
}]

console.log(ArrayReduce(arrJson))